<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui"> 


<h:form id="formAthleteExams" prependId="false" style="height:100%">
	<p:accordionPanel style="height:90%">
		<p:tab title="#{msgs.Exams}">
			<h:panelGrid columns="2">
				<p:dataTable id="medicalTable" value="#{athleteBean.medicalExams}" var="exam" paginator="true"  
					style="width:450px;margin-left:50px" paginatorAlwaysVisible="false"  paginatorPosition="bottom" rows="8" emptyMessage="#{msgs.NoResults}">
					<p:columnGroup type="header" >  
						<p:row>
							<p:column colspan="7" style="text-align:center;">
								<f:facet name="header">
									<h:outputText value="#{msgs.MedicalExams}" />
								</f:facet>
							</p:column>
							<p:column colspan="1"  styleClass="ui-table-button-row">
								<f:facet name="header">
									<p:commandButton type="button" onclick="wfindExam.show();" title="#{msgs.Filter}" icon="ui-icon-search"  styleClass="ui-table-button"/>
								</f:facet>
							</p:column>
						</p:row>
						<p:row>
							<p:column colspan="1"  styleClass="ui-table-button-row">
								<f:facet name="header">
									<p:commandButton type="button" title="#{msgs.Add}" onclick="wfindExam.show();" icon="ui-icon-plus" styleClass="ui-table-button"/>
								</f:facet>
							</p:column>
							<p:column	colspan="4">
								<f:facet name="header">
									<h:outputText value="#{msgs.Name}"/>
								</f:facet>
							</p:column>
							<p:column	colspan="1" >
								<f:facet name="header">
									<h:outputText value="#{msgs.ScheduledTo}"/>
								</f:facet>
							</p:column>
							<p:column	colspan="2" >
								<f:facet name="header">
									<h:outputText value="#{msgs.RealizedAt}" style="white-space: nowrap;"/>
								</f:facet>
							</p:column>
						</p:row>	
					</p:columnGroup> 
					<p:column colspan="2" headerText="#{msgs.Name}" >
						<h:outputText value="#{exam.name}" />
					</p:column>
	
					<p:column colspan="1" styleClass="ui-table-button-row" >
						<p:commandButton title="#{msgs.Edit}" action="#{athleteBean.editExam}" icon="ui-icon-pencil" styleClass="ui-table-button">
							<f:setPropertyActionListener target="#{athleteBean.selExam}" value="#{exam}"/>
						</p:commandButton>
					</p:column>		
	
					<p:column colspan="1" styleClass="ui-table-button-row" >
						<p:commandButton title="#{msgs.View}" action="#{athleteBean.viewExam}" icon="ui-icon-search" styleClass="ui-table-button">
							<f:setPropertyActionListener target="#{athleteBean.selExam}" value="#{exam}"/>
						</p:commandButton>
					</p:column>		
	
					<p:column colspan="1" styleClass="ui-table-button-row" >
						<p:commandButton title="#{msgs.Delete}" action="#{athleteBean.deleteExam}" icon="ui-icon-trash" styleClass="ui-table-button">
							<f:setPropertyActionListener target="#{athleteBean.selExam}" value="#{exam}"/>
						</p:commandButton>
					</p:column>		
					<p:column colspan="1" >
						<h:outputText value="#{exam.scheduledTo}">
							<f:convertDateTime locale="pt" dateStyle="long" pattern="dd/MM/yyyy HH:mm" />
						</h:outputText>
					</p:column>		
					<p:column colspan="2" >
						<h:outputText value="#{exam.realizaedAt}">
							<f:convertDateTime locale="pt" dateStyle="long" pattern="dd/MM/yyyy HH:mm" />
						</h:outputText>
					</p:column>		
				</p:dataTable>
				<p:dataTable id="psycTable" value="#{athleteBean.psycExams}" var="exam" paginator="true"  
					style="width:450px;margin-left:50px" paginatorAlwaysVisible="false"  paginatorPosition="bottom" rows="8" emptyMessage="#{msgs.NoResults}">
					<p:columnGroup type="header" >  
						<p:row>
							<p:column colspan="7" style="text-align:center;">
								<f:facet name="header">
									<h:outputText value="#{msgs.PsychometricEvaluation}" />
								</f:facet>
							</p:column>
							<p:column colspan="1"  styleClass="ui-table-button-row">
								<f:facet name="header">
									<p:commandButton type="button" onclick="wfindExam.show();" title="#{msgs.Filter}" icon="ui-icon-search"  styleClass="ui-table-button"/>
								</f:facet>
							</p:column>
						</p:row>
						<p:row>
							<p:column colspan="1"  styleClass="ui-table-button-row">
								<f:facet name="header">
									<p:commandButton type="button" title="#{msgs.Add}" onclick="wfindExam.show();" icon="ui-icon-plus" styleClass="ui-table-button"/>
								</f:facet>
							</p:column>
							<p:column	colspan="4">
								<f:facet name="header">
									<h:outputText value="#{msgs.Name}"/>
								</f:facet>
							</p:column>
							<p:column	colspan="1" >
								<f:facet name="header">
									<h:outputText value="#{msgs.ScheduledTo}"/>
								</f:facet>
							</p:column>
							<p:column	colspan="2" >
								<f:facet name="header">
									<h:outputText value="#{msgs.RealizedAt}" style="white-space: nowrap;"/>
								</f:facet>
							</p:column>
						</p:row>	
					</p:columnGroup> 
					<p:column colspan="2" headerText="#{msgs.Name}" >
						<h:outputText value="#{exam.name}" />
					</p:column>
	
					<p:column colspan="1" styleClass="ui-table-button-row" >
						<p:commandButton title="#{msgs.Edit}" action="#{athleteBean.editExam}" icon="ui-icon-pencil" styleClass="ui-table-button">
							<f:setPropertyActionListener target="#{athleteBean.selExam}" value="#{exam}"/>
						</p:commandButton>
					</p:column>		
	
					<p:column colspan="1" styleClass="ui-table-button-row" >
						<p:commandButton title="#{msgs.View}" action="#{athleteBean.viewExam}" icon="ui-icon-search" styleClass="ui-table-button">
							<f:setPropertyActionListener target="#{athleteBean.selExam}" value="#{exam}"/>
						</p:commandButton>
					</p:column>		
	
					<p:column colspan="1" styleClass="ui-table-button-row" >
						<p:commandButton title="#{msgs.Delete}" action="#{athleteBean.deleteExam}" icon="ui-icon-trash" styleClass="ui-table-button">
							<f:setPropertyActionListener target="#{athleteBean.selExam}" value="#{exam}"/>
						</p:commandButton>
					</p:column>		
					<p:column colspan="1" >
						<h:outputText value="#{exam.scheduledTo}">
							<f:convertDateTime locale="pt" dateStyle="long" pattern="dd/MM/yyyy HH:mm" />
						</h:outputText>
					</p:column>		
					<p:column colspan="2" >
						<h:outputText value="#{exam.realizaedAt}">
							<f:convertDateTime locale="pt" dateStyle="long" pattern="dd/MM/yyyy HH:mm" />
						</h:outputText>
					</p:column>		
				</p:dataTable>
			</h:panelGrid>
		</p:tab>
		<p:tab title="#{msgs.Evaluations}">
			<h:panelGrid columns="2">
				<p:dataTable id="performanceTable" value="#{athleteBean.perfomExams}" var="exam" paginator="true"  
					style="width:450px;margin-left:50px" paginatorAlwaysVisible="false"  paginatorPosition="bottom" rows="8" emptyMessage="#{msgs.NoResults}">
					<p:columnGroup type="header" >  
						<p:row>
							<p:column colspan="7" style="text-align:center;">
								<f:facet name="header">
									<h:outputText value="#{msgs.PerfomanceEvaluations}" />
								</f:facet>
							</p:column>
							<p:column colspan="1"  styleClass="ui-table-button-row">
								<f:facet name="header">
									<p:commandButton type="button" onclick="wfindExam.show();" title="#{msgs.Filter}" icon="ui-icon-search"  styleClass="ui-table-button"/>
								</f:facet>
							</p:column>
						</p:row>
						<p:row>
							<p:column colspan="1"  styleClass="ui-table-button-row">
								<f:facet name="header">
									<p:commandButton type="button" title="#{msgs.Add}" onclick="wfindExam.show();" icon="ui-icon-plus" styleClass="ui-table-button"/>
								</f:facet>
							</p:column>
							<p:column	colspan="4">
								<f:facet name="header">
									<h:outputText value="#{msgs.Name}"/>
								</f:facet>
							</p:column>
							<p:column	colspan="1" >
								<f:facet name="header">
									<h:outputText value="#{msgs.ScheduledTo}"/>
								</f:facet>
							</p:column>
							<p:column	colspan="2" >
								<f:facet name="header">
									<h:outputText value="#{msgs.RealizedAt}" style="white-space: nowrap;"/>
								</f:facet>
							</p:column>
						</p:row>	
					</p:columnGroup> 
					<p:column colspan="2" headerText="#{msgs.Name}" >
						<h:outputText value="#{exam.name}" />
					</p:column>
	
					<p:column colspan="1" styleClass="ui-table-button-row" >
						<p:commandButton title="#{msgs.Edit}" action="#{athleteBean.editExam}" icon="ui-icon-pencil" styleClass="ui-table-button">
							<f:setPropertyActionListener target="#{athleteBean.selExam}" value="#{exam}"/>
						</p:commandButton>
					</p:column>		
	
					<p:column colspan="1" styleClass="ui-table-button-row" >
						<p:commandButton title="#{msgs.View}" action="#{athleteBean.viewExam}" icon="ui-icon-search" styleClass="ui-table-button">
							<f:setPropertyActionListener target="#{athleteBean.selExam}" value="#{exam}"/>
						</p:commandButton>
					</p:column>		
	
					<p:column colspan="1" styleClass="ui-table-button-row" >
						<p:commandButton title="#{msgs.Delete}" action="#{athleteBean.deleteExam}" icon="ui-icon-trash" styleClass="ui-table-button">
							<f:setPropertyActionListener target="#{athleteBean.selExam}" value="#{exam}"/>
						</p:commandButton>
					</p:column>		
					<p:column colspan="1" >
						<h:outputText value="#{exam.scheduledTo}">
							<f:convertDateTime locale="pt" dateStyle="long" pattern="dd/MM/yyyy HH:mm" />
						</h:outputText>
					</p:column>		
					<p:column colspan="2" >
						<h:outputText value="#{exam.realizaedAt}">
							<f:convertDateTime locale="pt" dateStyle="long" pattern="dd/MM/yyyy HH:mm" />
						</h:outputText>
					</p:column>		
				</p:dataTable>
				<p:dataTable id="physiTable" value="#{athleteBean.physExams}" var="exam" paginator="true"  
					style="width:450px;margin-left:50px" paginatorAlwaysVisible="false"  paginatorPosition="bottom" rows="8" emptyMessage="#{msgs.NoResults}">
					<p:columnGroup type="header" >  
						<p:row>
							<p:column colspan="7" style="text-align:center;">
								<f:facet name="header">
									<h:outputText value="#{msgs.PhysiologicalEvaluations}" />
								</f:facet> 
							</p:column>
							<p:column colspan="1"  styleClass="ui-table-button-row">
								<f:facet name="header">
									<p:commandButton type="button" onclick="wfindExam.show();" title="#{msgs.Filter}" icon="ui-icon-search"  styleClass="ui-table-button"/>
								</f:facet>
							</p:column>
						</p:row>
						<p:row>
							<p:column colspan="1"  styleClass="ui-table-button-row">
								<f:facet name="header">
									<p:commandButton type="button" title="#{msgs.Add}" onclick="wfindExam.show();" icon="ui-icon-plus" styleClass="ui-table-button"/>
								</f:facet>
							</p:column>
							<p:column	colspan="4">
								<f:facet name="header">
									<h:outputText value="#{msgs.Name}"/>
								</f:facet>
							</p:column>
							<p:column	colspan="1" >
								<f:facet name="header">
									<h:outputText value="#{msgs.ScheduledTo}"/>
								</f:facet>
							</p:column>
							<p:column	colspan="2" >
								<f:facet name="header">
									<h:outputText value="#{msgs.RealizedAt}" style="white-space: nowrap;"/>
								</f:facet>
							</p:column>
						</p:row>	
					</p:columnGroup> 
					<p:column colspan="2" headerText="#{msgs.Name}" >
						<h:outputText value="#{exam.name}" />
					</p:column>
	
					<p:column colspan="1" styleClass="ui-table-button-row" >
						<p:commandButton title="#{msgs.Edit}" action="#{athleteBean.editExam}" icon="ui-icon-pencil" styleClass="ui-table-button">
							<f:setPropertyActionListener target="#{athleteBean.selExam}" value="#{exam}"/>
						</p:commandButton>
					</p:column>		
	
					<p:column colspan="1" styleClass="ui-table-button-row" >
						<p:commandButton title="#{msgs.View}" action="#{athleteBean.viewExam}" icon="ui-icon-search" styleClass="ui-table-button">
							<f:setPropertyActionListener target="#{athleteBean.selExam}" value="#{exam}"/>
						</p:commandButton>
					</p:column>		
	
					<p:column colspan="1" styleClass="ui-table-button-row" >
						<p:commandButton title="#{msgs.Delete}" action="#{athleteBean.deleteExam}" icon="ui-icon-trash" styleClass="ui-table-button">
							<f:setPropertyActionListener target="#{athleteBean.selExam}" value="#{exam}"/>
						</p:commandButton>
					</p:column>		
					<p:column colspan="1" >
						<h:outputText value="#{exam.scheduledTo}">
							<f:convertDateTime locale="pt" dateStyle="long" pattern="dd/MM/yyyy HH:mm" />
						</h:outputText>
					</p:column>		
					<p:column colspan="2" >
						<h:outputText value="#{exam.realizaedAt}">
							<f:convertDateTime locale="pt" dateStyle="long" pattern="dd/MM/yyyy HH:mm" />
						</h:outputText>
					</p:column>		
				</p:dataTable>			
			</h:panelGrid>			
		</p:tab>
	</p:accordionPanel>
	<div align="left"   >
		<p:commandButton  value="#{msgs.Save}"		action="#{academyBean.saveAcademy}"	ajax="true"	update=":growl"		icon="ui-icon-disk" />
		<p:spacer width="50px"/>	
		<p:commandButton  value="#{msgs.Cancel}"	action="#{academyBean.cancelChange}"	icon="ui-icon-cancel"/>
	</div>
</h:form>

</html>